package services

type RaWind struct {
	SendTime    string `json:"sendtime"`
	SendCompany string `json:"sendcompany"`
	Title       string `json:"title"`
	Data        []struct {
		Time string `json:"time"`
		Wind string `json:"wind"`
	} `json:"data"`
}

// GetRaWind 定时任务
func GetRaWind() {
	return
	//resp, err1 := http.Get("https://mp.wztf121.com/data/wzweather/yhwtfl/yhwtfl.json")
	//if err1 != nil {
	//	fmt.Println(err1)
	//}
	//defer resp.Body.Close()
	//// 读取响应内容
	//body, err1 := io.ReadAll(resp.Body)
	//if err1 != nil {
	//	fmt.Println(err1)
	//	return
	//}
	//var raWind RaWind
	//json.Unmarshal(body, &raWind)
	//fmt.Println(raWind.Data)
	//var raForeList []models.RaFore
	////FormatTime
	//y := strings.Split(raWind.SendTime, "年")[0]
	//for _, v := range raWind.Data {
	//	var raFore models.RaFore
	//	date := y + v.Time[0:2] + "-" + v.Time[3:5]
	//	raFore.Date = date
	//	raFore.WindValue = v.Wind
	//	raForeList = append(raForeList, raFore)
	//}
	//fmt.Println(raForeList)
}
